package com.example.androidproject.wallpaper.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.example.androidproject.R;
import com.example.androidproject.utils.GlobalFunction;
import com.example.androidproject.utils.RequestConstant;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class WallpaperContentActivity extends Activity {

    private ImageView iv_wallpaper_img;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wallpapercontent);

        Intent intent = getIntent();
        String classify = intent.getStringExtra("classify");
        String imgname = intent.getStringExtra("imgname");

        GlobalFunction.hideStatusBar(this);

        iv_wallpaper_img = findViewById(R.id.iv_wallpaper_img);

        String url = RequestConstant.WALLPAPER_IMG_URL + "?classify=" + classify + "&imgname=" + imgname + ".jpg";
        Glide.with(this).load(url).into(iv_wallpaper_img);

        setGesture();
    }

    private void setGesture() {
        // 单击一次
        iv_wallpaper_img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}